#!/bin/bash

# 检查Python环境
if ! command -v python3 &> /dev/null; then
    echo "Python未安装，请先安装Python"
    exit 1
fi

# 检查依赖是否已安装
python3 -c "import PyQt5, pyyaml, pymssql" &> /dev/null
if [ $? -ne 0 ]; then
    echo "正在安装依赖..."
    pip3 install -r requirements.txt
    if [ $? -ne 0 ]; then
        echo "依赖安装失败"
        exit 1
    fi
fi

# 启动程序
echo "启动程序..."
python3 main.py